/*
 * @Description: 自动引入组件库
 * @version:
 * @Author: sunqian_sr
 * @Date: 2022-11-22 15:34:23
 * @LastEditors: Andy
 * @LastEditTime: 2023-02-02 19:06:41
 */

import Vue from 'vue'
import commonComponents from '@package/components'

const context = import.meta.glob('../../components/common/**/**/index.js', { eager: true })
const allCommons = { ...commonComponents, ...context }
Object.keys(allCommons).forEach((key) => {
  try {
    Vue.use(allCommons[key].default)
  } catch (e) {
    throw new Error(`import ui components is fail${e}`)
  }
})
